package cn.acrdpm.entity;

import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 *  邮件实体类
 * @author 张敏
 * @date 2021/3/14
 */
@Data
@Accessors(chain = true)
public class Mail implements Serializable {

    private static final long serialVersionUID = -4611395613487247024L;

    @Pattern(regexp = "^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$", message = "邮箱格式不正确")
    private String to;

    @NotBlank(message = "标题不能为空")
    private String title;

    @NotBlank(message = "正文不能为空")
    private String content;
    // 消息id
    private String msgId;
}
